home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Toolbox / Visual Basic Toolbox (P.I.E.)(1996).ISO / lang_ext / tltips / form1.frm (.txt) next >
Encoding:
Visual Basic Form  |  1994-08-13  |  9.6 KB  |  258 lines

  1. VERSION 2.00
  2. Begin Form Form1 
  3.    Caption         =   "See Sub Readme ()"
  4.    ClientHeight    =   3000
  5.    ClientLeft      =   1275
  6.    ClientTop       =   1575
  7.    ClientWidth     =   2985
  8.    Height          =   3405
  9.    Left            =   1215
  10.    LinkTopic       =   "Form1"
  11.    ScaleHeight     =   3000
  12.    ScaleWidth      =   2985
  13.    Top             =   1230
  14.    Width           =   3105
  15.    Begin Data Data1 
  16.       Caption         =   "Data1"
  17.       Connect         =   ""
  18.       DatabaseName    =   ""
  19.       Exclusive       =   0   'False
  20.       Height          =   270
  21.       Left            =   1620
  22.       Options         =   0
  23.       ReadOnly        =   0   'False
  24.       RecordSource    =   ""
  25.       Top             =   2160
  26.       Width           =   1155
  27.    End
  28.    Begin PictureBox Picture2 
  29.       Height          =   315
  30.       Left            =   1560
  31.       ScaleHeight     =   285
  32.       ScaleWidth      =   1185
  33.       TabIndex        =   6
  34.       Top             =   840
  35.       Width           =   1215
  36.    End
  37.    Begin OptionButton Option1 
  38.       Caption         =   "Option1"
  39.       Height          =   255
  40.       Left            =   1560
  41.       TabIndex        =   5
  42.       Top             =   240
  43.       Width           =   1215
  44.    End
  45.    Begin CheckBox Check1 
  46.       Caption         =   "Check1"
  47.       Height          =   255
  48.       Left            =   120
  49.       TabIndex        =   4
  50.       Top             =   2160
  51.       Width           =   1155
  52.    End
  53.    Begin TextBox Text1 
  54.       Height          =   285
  55.       Left            =   120
  56.       TabIndex        =   3
  57.       Text            =   "Text1"
  58.       Top             =   240
  59.       Width           =   1215
  60.    End
  61.    Begin PictureBox Picture1 
  62.       Align           =   2  'Align Bottom
  63.       BackColor       =   &H00C0C0C0&
  64.       Height          =   315
  65.       Left            =   0
  66.       ScaleHeight     =   285
  67.       ScaleWidth      =   2955
  68.       TabIndex        =   2
  69.       Top             =   2685
  70.       Width           =   2985
  71.    End
  72.    Begin CommandButton Command1 
  73.       Caption         =   "Command1"
  74.       Height          =   375
  75.       Left            =   120
  76.       TabIndex        =   0
  77.       Top             =   1500
  78.       Width           =   1215
  79.    End
  80.    Begin Image Image1 
  81.       BorderStyle     =   1  'Fixed Single
  82.       Height          =   315
  83.       Left            =   1560
  84.       Top             =   1560
  85.       Width           =   1215
  86.    End
  87.    Begin Label Label1 
  88.       Caption         =   "Label1"
  89.       Height          =   195
  90.       Left            =   120
  91.       TabIndex        =   1
  92.       Top             =   900
  93.       Width           =   1215
  94.    End
  95. Dim Printed As Integer ' Declare variable (duhh...)
  96. Sub Check1_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)
  97. If Not Printed Then
  98.     Picture1.Print "This is a Check Box"
  99.     Printed = True
  100. End If
  101. ' This only executes if the tooltips bar is empty.
  102. ' And since it sets the it's own conditional variable,
  103. ' it only executes one time.
  104. End Sub
  105. Sub Command1_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)
  106. If Not Printed Then
  107.     Picture1.Print "This is a Command Button"
  108.     Printed = True
  109. End If
  110. ' This only executes if the tooltips bar is empty.
  111. ' And since it sets the it's own conditional variable,
  112. ' it only executes one time.
  113. End Sub
  114. Sub Data1_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)
  115. If Not Printed Then
  116.     Picture1.Print "This is a Data Control"
  117.     Printed = True
  118. End If
  119. ' This only executes if the tooltips bar is empty.
  120. ' And since it sets the it's own conditional variable,
  121. ' it only executes one time.
  122. End Sub
  123. Sub Form_Load ()
  124. Move (Screen.Width / 2 - Width / 2), (Screen.Height / 2 - Height / 2)
  125. Printed = False 'Let everybody know the tooltips bar is empty.
  126. End Sub
  127. Sub Form_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)
  128. If Printed Then
  129.     Picture1.Cls
  130.     Printed = False
  131. End If
  132. ' This only executes if the tooltips bar is NOT empty.
  133. ' And since it sets the it's own conditional variable,
  134. ' it only executes one time.
  135. End Sub
  136. Sub Image1_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)
  137. If Not Printed Then
  138.     Picture1.Print "This is an Image Control"
  139.     Printed = True
  140. End If
  141. ' This only executes if the tooltips bar is empty.
  142. ' And since it sets the it's own conditional variable,
  143. ' it only executes one time.
  144. End Sub
  145. Sub Label1_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)
  146. If Not Printed Then
  147.     Picture1.Print "This is a Label Control"
  148.     Printed = True
  149. End If
  150. ' This only executes if the tooltips bar is empty.
  151. ' And since it sets the it's own conditional variable,
  152. ' it only executes one time.
  153. End Sub
  154. Sub Option1_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)
  155. If Not Printed Then
  156.     Picture1.Print "This is an Option Button"
  157.     Printed = True
  158. End If
  159. ' This only executes if the tooltips bar is empty.
  160. ' And since it sets the it's own conditional variable,
  161. ' it only executes one time.
  162. End Sub
  163. Sub Picture1_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)
  164. If Not Printed Then
  165.     Picture1.Print "This is the ToolTips Bar"
  166.     Printed = True
  167. End If
  168. ' This only executes if the tooltips bar is empty.
  169. ' And since it sets the it's own conditional variable,
  170. ' it only executes one time.
  171. End Sub
  172. Sub Picture2_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)
  173. If Not Printed Then
  174.     Picture1.Print "This is a Picture Control"
  175.     Printed = True
  176. End If
  177. ' This only executes if the tooltips bar is empty.
  178. ' And since it sets the it's own conditional variable,
  179. ' it only executes one time.
  180. End Sub
  181. Sub Readme ()
  182. ' I'd been looking at various ways of implementing a
  183. ' "tooltips bar" (I think that's it's name), including
  184. ' some VBX's, DLL's, API calls, something that had a
  185. ' timer control in there somewhere, and a few other things.
  186. ' It all seemed pretty messy, so I started playing around.
  187. ' My first attempt at this yielded a tooltips bar, but the
  188. ' thing flickered on my 386 machine running plain VGA. I
  189. ' started looking at SendMessage when it occurred to me
  190. ' that all I needed to do was use "bad form" again. I say
  191. ' bad form because in the MDI app I was coding at the time,
  192. ' the variable "Printed" had to be Global, because the
  193. ' tooltips bar is on the MDI parent. And we all know that
  194. ' Globals and GoTos are bad form. (Could someone please
  195. ' explain that to me, again. I'm a fairly rank amateur.)
  196. ' Anyway, what's happening here is that in the declarations
  197. ' section, an integer variable is declared (in this case
  198. ' it's called "Printed"). Form_Load sets it to False.
  199. ' In the form's MouseMove event, the code clears the
  200. ' tooltips bar (a picture box with the align property set
  201. ' to 2-Bottom) and sets the variable to False.
  202. ' Then, in each of the control's MouseMove events, code is
  203. ' written to print a message in the tooltips bar, but ONLY
  204. ' if the control's code hasn't done so already (If NOT
  205. ' Printed Then...) since the third line in the If
  206. ' statement sets "Printed" to True. That prevents the code
  207. ' in the MouseMove event from executing with each one pixel
  208. ' shift in mouse cursor position (making it flicker, which
  209. ' by the way, doesn't show up much on my local bus
  210. ' screamer. I don't know how people can develope for
  211. ' Windows(tm) with only one machine. But I digress, again.)
  212. ' The same thing happens in the form's MouseMove event, but
  213. ' in reverse. The Form_MouseMove event clears the picture
  214. ' box, but only if it hasn't done so already (IF Printed
  215. ' Then blah blah, Printed = False). You'll have to make
  216. ' there is a little space between controls to make this
  217. ' code run. If you are using a toolbar that has buttons
  218. ' right up against each other, you could use a number
  219. ' rather than true..false to ensure that the code in the
  220. ' MouseMove event runs only one time, and that code
  221. ' will have to include the Picture1.Cls method.
  222. ' This code can be fooled by really quick mouse movement
  223. ' though. If your a stickler for such things, you ought
  224. ' to stay with GetCursorPos().
  225. ' If you find this code useful and decide to include it
  226. ' in one of your apps, you owe me 90 buzillion US bucks.
  227. ' In leu of that, I will accept a date with Samatha Fox.
  228. ' (You buy). In leu of that, just mention me in your app's
  229. ' help file or other documentation, if you want to.
  230. ' Or offer me a job (no joke). I can enforce this,
  231. ' by the way, since I have just perfected a disassembler
  232. ' that generates VB source code with comments intact.
  233. ' If any of the above doesn't make sense to you, or
  234. ' just want to chat, drop me a line at 72123,1243 (CIS),
  235. ' or on AOL to AaronCr.
  236. ' This part is not a joke: Use this code at your own risk.
  237. ' I accept no responsibilty for anything that happens
  238. ' when you use or run this sample code. I have no
  239. ' knowledge of any previous existance of any of this code
  240. ' It is, to my knowledge, purely the result of my own
  241. ' efforts.
  242. ' Enjoy!
  243. ' Aaron P. Crouse
  244. 'P.S. Look for me in this month's ZShare (#13) gloat, gloat.....
  245. ' Some of the things mentioned in here may be someone's
  246. ' copyright or trademark. If so, I appologize for any
  247. ' inadvertant credit omissions.
  248. End Sub
  249. Sub Text1_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)
  250. If Not Printed Then
  251.     Picture1.Print "This is an Edit Control"
  252.     Printed = True
  253. End If
  254. ' This only executes if the tooltips bar is empty.
  255. ' And since it sets the it's own conditional variable,
  256. ' it only executes one time.
  257. End Sub
  258.